package ar.com.fiuba.ElectronicCircuitAnalyst.domain.impl;

import java.util.List;

import ar.com.fiuba.ElectronicCircuitAnalyst.domain.api.Lead;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.api.LogicalFunction;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.api.Output;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.exceptions.EvaluationException;

public class OutputImpl implements Output {

	private Lead lead;
	private LogicalFunction function;

	public OutputImpl(Lead lead, LogicalFunction function) {
		this.lead = lead;
		this.function = function;
	}

	public void setOutput(List<Boolean> inputValues) throws EvaluationException {
		this.lead.setValue(this.function.evaluate(inputValues));
	}

	public Lead getOutputLead() {
		return this.lead;
	}

}
